#ifndef WINDOW_H
#define WINDOW_H
#include "FastDelegate.h"	// Header File For Delegates
#include "ProjectHeader.h"	// Header File For Class Decleration
#include <map>				// Header File For Map; Used to store callback delegates

class OpenGLWindow
{
public:
	bool		active;		// Window Active Flag Set To TRUE By Default
	static bool	keys[256];	// Array Used For The Keyboard Routine

	OpenGLWindow(HINSTANCE instance, OpenGLInit_delegate init, ResizeEvent_delegate resize);
	GLvoid KillGLWindow(GLvoid);
	void SwapWindowBuffers();
	bool CreateGLWindow(char* title, int width, int height, int bits, bool fullscreenflag);
	bool registerEvent( const Callback_delegate, const UINT );

private:
	HWND		hWnd;		// Holds Our Window Handle
	HWND		m_hWnd;
	HDC			hDC;		// Private GDI Device Context
	HGLRC		hRC;		// Permanent Rendering Context
	HINSTANCE hInstance;	
	LRESULT WndProc( UINT, WPARAM, LPARAM);
	static LRESULT CALLBACK StaticWndProc(HWND, UINT, WPARAM, LPARAM);	// Declaration For WndProc
	std::map<UINT, Callback_group> HandlerRegistry;						// Holds delegates  for callbacks, and events which invoke them
	bool			fullscreen;											// Fullscreen Flag
	OpenGLInit_delegate	InitGL;											// Delegate to call to initialise openGL
	ResizeEvent_delegate ResizeGL;
};
#endif